home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-15 | 2.5 KB | 90 lines | [TEXT/CWIE] |
- // Copyright © 1995 Apple Computer, Inc. All rights reserved.
- // Release Version: $ 1.0 d11 $
-
- //=======================================================================
- #ifndef FRAME_H
- #include "Frame.h"
- #endif
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- // ----- Framework Layer -----
- #ifndef FWUTIL_H
- #include "FWUtil.h" // FW_CFacetContext, FW_Beep()
- #endif
-
- #ifndef FWCONTXT_H
- #include "FWContxt.h" // FW_CViewContext
- #endif
-
- // ----- Graphic Includes -----
- #ifndef FWRECT_H
- #include <FWRect.h> // FW_CRect
- #endif
-
- #ifndef FWRECSHP_H
- #include "FWRecShp.h" // FW_CRectShape
- #endif
-
- #ifndef SOM_DevUniv_STalker_xh
- #include "STalker.xh" // for STalker
- #endif
-
- //========================================================================================
- #ifdef FW_BUILD_MAC
- #pragma segment Sample3
- #endif
-
- //========================================================================================
- FW_DEFINE_AUTO(CSample3Frame)
-
- const FW_Boolean kWaitUntilDone = TRUE; // don't return until talking is finished.
- //========================================================================================
- CSample3Frame::CSample3Frame(Environment* ev, ODFrame* odFrame,
- FW_CPresentation* presentation, CSample3Part* sample3Part)
- : FW_CFrame(ev, odFrame, presentation, sample3Part),
- fSOMTalker(NULL)
- {
- #ifdef FW_BUILD_MAC // can we do text-to-speech on Windows?
- fSOMTalker = new DevUniv_STalker;
- fSOMTalker->SayString(ev, "I use ODF", !kWaitUntilDone); // say it!
- #endif
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- CSample3Frame::~CSample3Frame()
- {
- FW_START_DESTRUCTOR
- #ifdef FW_BUILD_MAC
- delete fSOMTalker;
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- void
- CSample3Frame::Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape) // Override
- {
- FW_CViewContext context(ev, this, odFacet, invalidShape);
- FW_CRect frameRect = this->GetBounds(ev);
-
- // fill frame with green
- FW_CRectShape rectShape(frameRect, FW_kFill);
- rectShape.GetInk().SetForeColor(FW_kRGBGreen);
- rectShape.Render(context);
- }
-
- //----------------------------------------------------------------------------------------
- FW_Boolean
- CSample3Frame::DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent)
- {
- FW_UNUSED(ev);
- FW_UNUSED(theMouseEvent);
- #ifdef FW_BUILD_MAC
- fSOMTalker->SayString(ev, "Oh Boy", !kWaitUntilDone); // say it!
- #endif
- return TRUE; // we handled event
- }
-